import { getCurrentInstance } from 'vue';
export const useDomHeight = (tagId: string) => {
  const height = ref();
  const id = tagId;
  onMounted(() => {
    const instance = getCurrentInstance();
    setTimeout(() => {
      const query = uni.createSelectorQuery().in(instance);
      query
        .select(id)
        .boundingClientRect((data: any) => {
          height.value = data.height;
          console.log(id + ' height: ' + height.value);
        })
        .exec();
    }, 0);
  });
  return {
    height,
  };
};
